<?php include "../../../config.php" ;?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <?php include "../controller/refund_apply.php" ;?>
    <?php include 'modules/head.php'; ?>
</head>

<body id="top" class="binding">

<?php include 'modules/header.php'; ?>




<div class="mui-content">











<?
//==============================================================================
//这里开始才是平常开发需要注重的部分，其余的基本不用理会
//==============================================================================
?>

<div id="window">



    <ul class="detail-box" style="padding-bottom: 25px" >


            <input type="hidden"  name="order_id" value="<? echo $order_info['order_id']?>" >



        <h4>订单资料</h4>


            <div class="layui-row">
                <div class="layui-col-md5" >
                <!--普通的input文本输入-->

                    <li class="layui-form-item name">
                        <label class="layui-form-label">客户订单号：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" disabled  value="<? echo $order_info['order_sn']?>">
                        </div>
                    </li>


                    <li class="layui-form-item name">
                        <label class="layui-form-label">TRANSACTION_ID：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" disabled  value="<? echo $order_info['transaction_id']?>">
                        </div>
                    </li>



                    <li class="layui-form-item name">
                        <label class="layui-form-label">订单编号：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" disabled  value="<? echo $order_info['order_id']?>">
                        </div>
                    </li>




                    <li class="layui-form-item name">
                <label class="layui-form-label">产品：</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" disabled  value="<? echo $order_info['order_name'] ?>">
                </div>
            </li>



            <!--普通的input文本输入-->
            <li class="layui-form-item name">
                <label class="layui-form-label">价格：</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" disabled  value="<? echo $order_info['order_price'] ?>">
                </div>
            </li>


            <!--普通的input文本输入-->
            <li class="layui-form-item name">
                <label class="layui-form-label">学生：</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input" name="ai_student_name" disabled  value="<? echo $order_info['student_name'] ?>">
                </div>
            </li>


                    <!--普通的input文本输入-->
                    <li class="layui-form-item name">
                        <label class="layui-form-label">班别：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" name="ai_student_info" disabled value="<?echo  $order_info['student_info']?>">
                        </div>
                    </li>




                    <li class="layui-form-item name">
                        <label class="layui-form-label">家长电话：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" disabled  value="<? echo $user['phone'] ?>">
                        </div>
                    </li>


                </div>


                <div class="layui-col-md5" >

                    <!--普通的textarea多行文本输入-->
                    <li class="layui-form-item introduce">
                        <label class="layui-form-label">申请日期：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input laydate_time" disabled value="<?echo $order_info['refund_apply_date']?>"/>
                        </div>
                    </li>



                    <!--普通的textarea多行文本输入-->
                    <li class="layui-form-item introduce">
                        <label class="layui-form-label">支付状态：</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input laydate_time" disabled value="<?echo $pay_status[$order_info['pay_status']]?>"/>
                        </div>
                    </li>





                    <!--普通的textarea多行文本输入-->
                    <li class="layui-form-item introduce">
                        <label class="layui-form-label">退款原因：</label>
                        <div class="layui-input-block">
                            <textarea class="layui-textarea"  name="ai_refund_reason"><?echo  $order_info['refund_reason']?>   </textarea>
                        </div>
                    </li>



                </div>
            </div>





            <div style="margin: 40px 0; display: none" >
                <h4>退款记录</h4>


            <?if(count(array_filter($refund_info))){?>

                <table  class="layui-table">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>退款金额</th>
                        <th>用户申请时间</th>
                        <th>退款时间</th>
                        <th>内部申请时间</th>
                        <th>申请人</th>
                        <th>退款理由</th>
                        <th>停止配送时间</th>
                        <th>审核状态</th>
                        <th>审核时间</th>
                    </tr>
                    </thead>
                    <tbody>

                    <?php
                    foreach ($refund_apply_list as $key2=> $value2) {
                        ?>
                        <tr>
                            <td><?echo $value2['nid']?></td>
                            <td><?echo $value2['price']?></td>
                            <td> </td>
                            <td> </td>
                            <td><?echo $value2['apply_date']?></td>
                            <td><?echo $value2['apply_employee']?></td>
                            <td><?echo $value2['remark']?></td>
                            <td><?echo $value2['stop_delivery_date']?></td>
                            <td><?echo $value2['apply_status']?></td>
                            <td><?echo $value2['aprove_date']?></td>
                        </tr>
                    <?}?>

                    <?php
                    foreach ($refund_info as $key => $value) {
                        ?>
                        <tr>
                            <td><?echo $value['nid']?></td>
                            <td><?echo $value['price']/100?></td>
                            <td></td>
                            <td><?echo $value['add_date']?></td>
                            <td> </td>
                            <td> </td>
                            <td> </td>
                            <td> </td>
                            <td> </td>
                            <td> </td>
                        </tr>
                    <?}?>

                    </tbody>
                </table>
                <?;}else{?>
                <div style="text-align: center">暂无退款记录</div>

            <?}?>
            </div>




        <h4>退款申请</h4>


        <!--普通的textarea多行文本输入-->
        <li class="layui-form-item introduce">
            <label class="layui-form-label">申请编号：</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input"     disabled  value="<?echo $refund_apply_data['nid']?>"/>
            </div>
        </li>


        <!--普通的textarea多行文本输入-->
        <li class="layui-form-item introduce">
            <label class="layui-form-label">申请人：</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input"  id="price"   disabled  value="<?echo $refund_apply_data['apply_employee']?>"/>
            </div>
        </li>


            <!--普通的textarea多行文本输入-->
            <li class="layui-form-item introduce">
                <label class="layui-form-label">申请日期：</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input laydate_time" disabled value="<?echo $refund_apply_data['apply_date']?>"/>
                </div>
            </li>




        <li class="layui-form-item introduce">
            <label class="layui-form-label">停止配送：</label>
            <div class="layui-input-block">
                <?foreach ($order_detail as $key => $value){?>
                    <div class="mui-input-row mui-checkbox mui-left">
                        <label><?echo substr($value['ondate'],0,10)?> - <?echo $value['status']?></label>
                        <input type="checkbox" name="ai_stop_deliver_date[]" disabled

                            <?if(in_array($value['ondate'],$refund_apply_stop_deliver)){echo "checked";}?>
                                value="<?echo $value['ondate']?>"/>
                    </div>



                <?}?>
                <br class="clearfloat"/>
                <em class="notice" style="color: red">停止配送日期，将会在退款申请审核之后，生效。请注意审核<br/></em>
            </div>
        </li>



        <!--普通的textarea多行文本输入-->
            <li class="layui-form-item introduce">
                <label class="layui-form-label">退款金额：</label>
                <div class="layui-input-block">
                    <input type="text" class="layui-input"  id="price"   disabled  value="<?echo $refund_apply_data['price']?>"/>
                </div>
            </li>



            <!--普通的textarea多行文本输入-->
            <li class="layui-form-item introduce">
                <label class="layui-form-label">申请备注：</label>
                <div class="layui-input-block">
                    <textarea class="layui-textarea"  disabled  ><?echo  $refund_apply_data['remark']?></textarea>
                    <em class="notice">(填写本文的概述)</em>
                </div>
            </li>


        <h4>申请审核</h4>

        <form id="data_form" method="post" class="layui-form"
              action ="/controller/extender/finance/view/data_apply_aprove_process.php?<? echo $url_parameter ?>"
              enctype="multipart/form-data">

            <input type="hidden"  name="nid" value="<? echo $_REQUEST['nid']?>" >


            <!--单选项-->
            <li class="layui-form-item publish">
                <label class="layui-form-label">审核状态：</label>
                <div class="mui-input-row mui-radio mui-left">
                <label>同意</label>
                    <input  type='radio' name="ai_apply_status"   title="同意" value="同意" checked/>
                </div>

                <div class="mui-input-row mui-radio mui-left">
                    <label>驳回</label>
                    <input  type='radio' name="ai_apply_status"   title="驳回" value="驳回" />
                </div>


            </li>



            <!--普通的textarea多行文本输入-->
            <li class="layui-form-item introduce">
                <label class="layui-form-label">审核备注：</label>
                <div class="layui-input-block">
                    <textarea class="layui-textarea" name="ai_aprove_reason"  ><?echo  $refund_apply_data['aprove_reason']?></textarea>
                </div>
            </li>





            <div class="function">

                <button class="layui-btn"  lay-submit type="submit" >立即提交</button>

                <input type="reset" class="layui-btn" value="重置"/>

            </div>



        </form>
    </ul>

</div>



<?
//==============================================================================
//这里上面才是平常开发需要注重的部分，下面的基本不用理会，只有底部JS部分需要根据实际情况去加载
//==============================================================================
?>

</div>



</body>
</html>